<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>pattern 属性</title>
</head>
<body>

<form action="/example/html5/demo_form.asp" method="get">
  国家代码：<input type="text" name="country_code" pattern="[A-z]{3}"
                  title="三个字母的国家代码" />
  <input type="submit" />
</form>

</body>
</html>